package com.cloud.message.controller;

import com.cloud.common.domain.Result;
import com.cloud.entity.vo.NoticeParam;
import com.cloud.message.service.IMessageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "消息管理")
@RestController
@RequestMapping("/message/notice")
public class MessageController {

    @Autowired
    private IMessageService messageService;

    @Operation(summary = "指定用户发送邮件信息")
    @PostMapping("/inAuth/sendMailNotice")
    public Result sendNoticeList(@RequestBody NoticeParam noticeParam) {
        return Result.success("操作成功", messageService.sendMailNotice(noticeParam));
    }

    @Operation(summary = "指定用户发送浙政钉消息")
    @PostMapping("/inAuth/sendDingTalkNotice")
    public Result sendDingTalkNotice(@RequestBody NoticeParam noticeParam) {
        return Result.success("操作成功", messageService.sendDingTalkNotice(noticeParam));
    }

}
